package com.weigang.mybatis.controller;

import com.weigang.mybatis.entity.HrUser;
import com.weigang.mybatis.service.HrUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class HrUserController {

    @Resource
    private HrUserService hrUserService;

    @GetMapping(value = "/getUsers")
    public List<HrUser> getUsers(){
        return hrUserService.getUsers();//http://localhost:8080/user/getUsers
    }

}
